﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using Librerias;

namespace eCampusWeb
{
    public partial class Acceso : System.Web.UI.Page
    {
        ENUsuario en;
        protected void Page_Load(object sender, EventArgs e)
        {
            en = new ENUsuario();
        }

        /*
        protected void CreaCookie()
        {
            HttpCookie userCookie;
          //  userCookie = Request.Cookies["UserID"];
          //  if (userCookie == null)
          //  {
                userCookie = new HttpCookie("UserID", Login2.UserName);
                userCookie.Expires = DateTime.Now.AddMonths(1);
                Response.Cookies.Add(userCookie);
          //  }
        }
        */

        protected void OnAuthenticate(object sender, AuthenticateEventArgs e)
        {
            e.Authenticated = false;

            en.Correo = Login2.UserName;
            en.Contraseña = Login2.Password;
            if (en.Validar())
            {
                e.Authenticated = true;
            }
        }

    }
}